package com.yc.cinema.biz;

import com.yc.cinema.bean.User;
import com.yc.cinema.dao.UserDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserBiz {
	@Resource
	private UserDao udao;

	// 初始化方法
	public void init(){}
	// 销毁方法
	public void destroy(){

	}

	public User login(String name, String pwd) {
		System.out.println("ubiz.login");
		User user = new User();
		user.setUsername(name);
		user.setPassword(pwd);
		user.setEmail(name+"@qq.com");
		return user;
	}

	public void register(User user) throws BizException {
		throw new RuntimeException("注册失败!");
	}

	public UserDao getUdao() {
		return udao;
	}

	public void setUdao(UserDao udao) {
		this.udao = udao;
	}



}
